package ronglei.day01.demo06ArrayList;

import java.util.ArrayList;

public class ArrayList07 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<String>();
        list.add("rong");
        list.add("ong");
        list.add("rog");
        System.out.println(list);
        prini(list);
    }
    public static  void prini(ArrayList<String> list){
        System.out.print('{');
        for (int i = 0; i < list.size(); i++) {
            String name = list.get(i);
            if(i==list.size()-1){
                System.out.println(name+"}");
            }else{
                System.out.print(name+"$");

            }
        }
    }
}
